package com.moxiao.yfjh.module.blind.dal.mysql.basicSetting;

import com.moxiao.yfjh.module.blind.controller.admin.basicSetting.vo.BlindBasicSettingExportReqVO;
import com.moxiao.yfjh.module.blind.controller.admin.basicSetting.vo.BlindBasicSettingPageReqVO;
import java.util.*;

import com.moxiao.yfjh.framework.common.pojo.PageResult;
import com.moxiao.yfjh.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.moxiao.yfjh.framework.mybatis.core.mapper.BaseMapperX;
import com.moxiao.yfjh.module.blind.dal.dataobject.basicSetting.BlindBasicSettingDO;
import org.apache.ibatis.annotations.Mapper;
import com.moxiao.yfjh.module.blind.controller.admin.basicSetting.vo.*;

/**
 * 相亲基础设置 Mapper
 *
 * @author mx
 */
@Mapper
public interface BlindBasicSettingMapper extends BaseMapperX<BlindBasicSettingDO> {

    default PageResult<BlindBasicSettingDO> selectPage(BlindBasicSettingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BlindBasicSettingDO>()
                .eqIfPresent(BlindBasicSettingDO::getMatchUser, reqVO.getMatchUser())
                .eqIfPresent(BlindBasicSettingDO::getMatchNonUser, reqVO.getMatchNonUser())
                .eqIfPresent(BlindBasicSettingDO::getLikeNum, reqVO.getLikeNum())
                .eqIfPresent(BlindBasicSettingDO::getMorningBegin, reqVO.getMorningBegin())
                .eqIfPresent(BlindBasicSettingDO::getMorningEnd, reqVO.getMorningEnd())
                .eqIfPresent(BlindBasicSettingDO::getAfternoonBegin, reqVO.getAfternoonBegin())
                .eqIfPresent(BlindBasicSettingDO::getAfternoonEnd, reqVO.getAfternoonEnd())
                .eqIfPresent(BlindBasicSettingDO::getCommentAuth, reqVO.getCommentAuth())
                .betweenIfPresent(BlindBasicSettingDO::getProcessTime, reqVO.getProcessTime())
                .eqIfPresent(BlindBasicSettingDO::getCommissionRatio, reqVO.getCommissionRatio())
                .betweenIfPresent(BlindBasicSettingDO::getEffectiveTime, reqVO.getEffectiveTime())
                .eqIfPresent(BlindBasicSettingDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(BlindBasicSettingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlindBasicSettingDO::getId));
    }

    default List<BlindBasicSettingDO> selectList(BlindBasicSettingExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BlindBasicSettingDO>()
                .eqIfPresent(BlindBasicSettingDO::getMatchUser, reqVO.getMatchUser())
                .eqIfPresent(BlindBasicSettingDO::getMatchNonUser, reqVO.getMatchNonUser())
                .eqIfPresent(BlindBasicSettingDO::getLikeNum, reqVO.getLikeNum())
                .eqIfPresent(BlindBasicSettingDO::getMorningBegin, reqVO.getMorningBegin())
                .eqIfPresent(BlindBasicSettingDO::getMorningEnd, reqVO.getMorningEnd())
                .eqIfPresent(BlindBasicSettingDO::getAfternoonBegin, reqVO.getAfternoonBegin())
                .eqIfPresent(BlindBasicSettingDO::getAfternoonEnd, reqVO.getAfternoonEnd())
                .eqIfPresent(BlindBasicSettingDO::getCommentAuth, reqVO.getCommentAuth())
                .betweenIfPresent(BlindBasicSettingDO::getProcessTime, reqVO.getProcessTime())
                .eqIfPresent(BlindBasicSettingDO::getCommissionRatio, reqVO.getCommissionRatio())
                .betweenIfPresent(BlindBasicSettingDO::getEffectiveTime, reqVO.getEffectiveTime())
                .eqIfPresent(BlindBasicSettingDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(BlindBasicSettingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlindBasicSettingDO::getId));
    }

}
